/******************************************************************************* 
 *  Copyright 2007 Amazon Technologies, Inc.  
 *  Licensed under the Apache License, Version 2.0 (the "License"); 
 *  
 *  You may not use this file except in compliance with the License. 
 *  You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
 *  CONDITIONS OF ANY KIND, either express or implied. See the License for the 
 *  specific language governing permissions and limitations under the License.
 * ***************************************************************************** 
 *    __  _    _  ___ 
 *   (  )( \/\/ )/ __)
 *   /__\ \    / \__ \
 *  (_)(_) \/\/  (___/
 * 
 *  Amazon ECS CSharp Library
 *  API Version: 2007-07-16
 *  Generated: Thu Aug 02 10:15:38 PDT 2007 
 * 
 */

using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using Amazon.ECS;
using Amazon.ECS.Query;
using Amazon.ECS.Mock;
using Amazon.ECS.Model;
using Amazon.ECS.Samples.Amazone;

namespace Amazon.ECS.Samples
{

    /// <summary>
    /// Amazon ECS  Samples
    /// </summary>
    public class AmazonECSSamples 
    {
    
       /**
        * Samples for Amazon ECS functionality
        */
        public static void Main(string [] args) 
        {
            Console.WriteLine("===========================================");
            Console.WriteLine("Welcome to Amazon ECS Samples!");
            Console.WriteLine("===========================================");

            Console.WriteLine("To get started:");
            Console.WriteLine("===========================================");
            Console.WriteLine("  - Fill in your AWS Access Key ID");
            Console.WriteLine("  - Uncomment sample you're interested in trying");
            Console.WriteLine("  - Set request with desired parameters");
            Console.WriteLine("  - Hit F5 to run!");
            Console.WriteLine();

            Console.WriteLine("===========================================");
            Console.WriteLine("Samples Output");
            Console.WriteLine("===========================================");
            Console.WriteLine();

           /************************************************************************
            * Access Key ID obtained from:
            * http://aws.amazon.com
            ***********************************************************************/
            //keywordReq.locale = "us";
            //keywordReq.type = "lite";
            ////keywordReq.sort = "reviewrank";
            //keywordReq.mode = "Books";
            //keywordReq.keyword = "Web 2.0";
            //keywordReq.devtag = accessKeyId;
            //keywordReq.tag = accessKeyId;
            //var sciema = new Amazone.AmazonSearchService();
            //ProductInfo info = sciema.KeywordSearchRequest(keywordReq); 

            /************************************************************************
            * Instantiate Query Implementation of Amazon ECS 
            ***********************************************************************/
            
            /************************************************************************
             * Uncomment to invoke library on different Locale. Available Locales:
             * 
             *  - US
             *  - UK
             *  - FR
             *  - JP
             *  - CA
             *  - DE
             *
             * To override any of the locale specific configuration, preconfigure
             * locale before passing it to the service constructor:
             *
             * AmazonECSLocale locale = AmazonECSLocale.DE;
             * locale.Config.ServiceURL = "http://localeurl";
             * AmazonECS service = new AmazonECSQuery(accessKeyId, associateTag, locale);
             *
             ***********************************************************************/
            // AmazonECS service = new AmazonECSQuery(accessKeyId, associateTag, AmazonECSLocale.US);
        
           /************************************************************************
            * Uncomment to try out Mock Service that simulates Amazon ECS 
            * responses without calling Amazon ECS  service.
            *
            * Responses are loaded from local XML files. You can tweak XML files to
            * experiment with various outputs during development
            *
            * XML files available under Amazon/ECS/mock tree
            *
            ***********************************************************************/
            // AmazonECS service = new AmazonECSMock();


            /************************************************************************
            * Help  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // HelpRequest request = new HelpRequest();
            // @TODO: set request parameters here
            // HelpSample.InvokeHelp(service, request);

            /************************************************************************
            * Item Search  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // ItemSearchRequest request = new ItemSearchRequest();
            //request.SearchIndex = "Books";
            //request.Publisher = "addison wesley";
            //request.ItemPage = 1;
            // ItemSearchSample.InvokeItemSearch(service, request);

            /************************************************************************
            * Item Lookup  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/

            String accessKeyId = "1FSSNYS4T9YMWMNCBQG2";
            AmazonECS service = new AmazonECSQuery(accessKeyId, null);
            KeywordRequest keywordReq = new KeywordRequest();
            ItemLookupRequest request1 = new ItemLookupRequest();
            request1.IdType = "ASIN";
            request1.ItemId.Add("0201633612");
            request1.ResponseGroup.Add("ItemAttributes");

            ItemLookupRequest request2 = new ItemLookupRequest();
            request2.IdType = "ASIN";
            request2.ItemId.Add("0321336380");
            request2.ResponseGroup.Add("ItemAttributes");

            // @TODO: set request parameters here
            var lookup = service.ItemLookup(request1, request2);

            /************************************************************************
            * Browse Node Lookup  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
             //BrowseNodeLookupRequest request = new BrowseNodeLookupRequest();
             //request.BrowseNodeId.Add("71"); 
             //BrowseNodeLookupSample.InvokeBrowseNodeLookup(service, request);

            /************************************************************************
            * List Search  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            //ListSearchRequest request = new ListSearchRequest();
            //// @TODO: set request parameters here
            //request.ListType = "WeddingRegistry";
            //ListSearchSample.InvokeListSearch(service, request);

            /************************************************************************
            * List Lookup  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // ListLookupRequest request = new ListLookupRequest();
            // @TODO: set request parameters here
            // ListLookupSample.InvokeListLookup(service, request);

            /************************************************************************
            * Customer Content Search  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // CustomerContentSearchRequest request = new CustomerContentSearchRequest();
            // @TODO: set request parameters here
            // CustomerContentSearchSample.InvokeCustomerContentSearch(service, request);

            /************************************************************************
            * Customer Content Lookup  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // CustomerContentLookupRequest request = new CustomerContentLookupRequest();
            // @TODO: set request parameters here
            // CustomerContentLookupSample.InvokeCustomerContentLookup(service, request);

            /************************************************************************
            * Similarity Lookup  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // SimilarityLookupRequest request = new SimilarityLookupRequest();
            // @TODO: set request parameters here
            // SimilarityLookupSample.InvokeSimilarityLookup(service, request);

            /************************************************************************
            * Seller Lookup  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // SellerLookupRequest request = new SellerLookupRequest();
            // @TODO: set request parameters here
            // SellerLookupSample.InvokeSellerLookup(service, request);

            /************************************************************************
            * Cart Get  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // CartGetRequest request = new CartGetRequest();
            // @TODO: set request parameters here
            // CartGetSample.InvokeCartGet(service, request);

            /************************************************************************
            * Cart Add  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // CartAddRequest request = new CartAddRequest();
            // @TODO: set request parameters here
            // CartAddSample.InvokeCartAdd(service, request);

            /************************************************************************
            * Cart Create  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // CartCreateRequest request = new CartCreateRequest();
            // @TODO: set request parameters here
            // CartCreateSample.InvokeCartCreate(service, request);

            /************************************************************************
            * Cart Modify  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // CartModifyRequest request = new CartModifyRequest();
            // @TODO: set request parameters here
            // CartModifySample.InvokeCartModify(service, request);

            /************************************************************************
            * Cart Clear  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // CartClearRequest request = new CartClearRequest();
            // @TODO: set request parameters here
            // CartClearSample.InvokeCartClear(service, request);

            /************************************************************************
            * Transaction Lookup  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // TransactionLookupRequest request = new TransactionLookupRequest();
            // @TODO: set request parameters here
            // TransactionLookupSample.InvokeTransactionLookup(service, request);

            /************************************************************************
            * Seller Listing Search  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // SellerListingSearchRequest request = new SellerListingSearchRequest();
            // @TODO: set request parameters here
            // SellerListingSearchSample.InvokeSellerListingSearch(service, request);

            /************************************************************************
            * Seller Listing Lookup  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // SellerListingLookupRequest request = new SellerListingLookupRequest();
            // @TODO: set request parameters here
            // SellerListingLookupSample.InvokeSellerListingLookup(service, request);

            /************************************************************************
            * Tag Lookup  Sample
            *
            * Setup request parameters and uncomment to try out sample 
            ***********************************************************************/
            // TagLookupRequest request = new TagLookupRequest();
            // @TODO: set request parameters here
            // TagLookupSample.InvokeTagLookup(service, request);

            Console.WriteLine();
            Console.WriteLine("===========================================");
            Console.WriteLine("End of output. You can close this window");
            Console.WriteLine("===========================================");
            System.Threading.Thread.Sleep(50000);
        }

    }
}
